
cbuffer ParticleUpdateInfo : register(b0, space0)
{
    float4 g_info : packoffset(c0);
}

struct PARAMS_IN
{
    [[vk::location(0)]] float2 vPos : MY_POS;
    [[vk::location(3)]] float4 vClr : MY_CLR;
};

struct PARAMS_OUT
{
    float4 k_pos                    : SV_Position;
    [[vk::location(0)]] float4 vClr : MY_CLR;
};

[maxvertexcount(6)]
void main( point PARAMS_IN pIn[1], inout TriangleStream<PARAMS_OUT> pOutStream )
{
    PARAMS_OUT center;
    center.k_pos = float4(pIn[0].vPos, 0.0, 1.0);
    center.vClr = pIn[0].vClr;
    
    PARAMS_OUT lt = center;
    lt.k_pos.xy += float2(-g_info.x, g_info.y);

    PARAMS_OUT lb = center;
    lb.k_pos.xy += -g_info.xy;

    PARAMS_OUT rb = center;
    rb.k_pos.xy += float2(g_info.x, -g_info.y);

    PARAMS_OUT rt = center;
    rt.k_pos.xy += g_info.xy;

    pOutStream.Append(lt);
    pOutStream.Append(lb);
    pOutStream.Append(rb);
    pOutStream.RestartStrip();

    pOutStream.Append(rb);
    pOutStream.Append(rt);
    pOutStream.Append(lt);
    pOutStream.RestartStrip();
}

